<template>
  <div class="limit_box">
    <div class="limit_head">
      <router-link to="/Index">
        <div class="back">&lt;</div>
      </router-link>
      <p>限量发售</p>
      <div class="right">
        <img src="image/local.jpg" alt="" />
        <span>西安市 ﹀</span>
      </div>
    </div>
    <div class="act">
      <img src="image/limit.jpg" alt="" />
    </div>
    <ul>
      <li v-for="limit in limits" :key="limit.id">
        <img :src="limit.img" />
        <p>西安发售-{{ limit.name }}</p>
        <div>
          <span class="price">¥{{ limit.price }}</span>
          <span class="date">{{ limit.date }}</span>
        </div>
        <button>查看详情</button>
      </li>
    </ul>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "limit",
  props: {
    type: String,
  },
  data() {
    return {
      limits: [],
    };
  },
  created() {
    axios({
      url: "/limits",
      method: "get",
    }).then((res) => {
      this.limits = res.data;
      console.log(res.data);
    });
  },
};
</script>

<style>
html,
body {
  height: 100%;
}
html {
  font-size: 26.67vw;
}
ul {
  list-style: none;
}
body {
  font-size: 16px;
  display: flex;
  flex-direction: column;
}
.limit_box {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}
.limit_head {
  width: 100%;
  height: 0.55rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  top: 0;
  background-color: #fff;
}
.limit_head .back {
  width: 30%;
  font-size: 0.3rem;
}
.limit_head > p {
  width: 40%;
  font-size: 0.18rem;
  font-weight: 700;
  text-align: center;
  position: relative;
  left: 0.4rem;
}
.limit_head > .right {
  display: flex;
  width: 30%;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
}
.limit_head > .right > img {
  width: 0.25rem;
  height: 0.25rem;
}
.limit_head > .right > span {
  font-size: 0.14rem;
}
.act {
  width: 100%;
  height: 0.9rem;
  margin-top: 0.6rem;
}
.act > img {
  width: 1.7rem;
}
.limit_box > ul > li {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  margin-bottom: 0.2rem;
}
.limit_box > ul > li > img {
  width: 100%;
}
.limit_box > ul > li > p {
  font-size: 0.16rem;
  font-weight: 600;
  margin:0 0.15rem;
}
.limit_box > ul > li > div {
  font-size: 0.14rem;
  display: flex;
  margin: 0.1rem 0.15rem;
  justify-content: space-between;
  align-items: center;
}
.limit_box > ul > li > div>.date{
    font-size: .12rem;
    color: #a8a8a8;
}
.limit_box > ul > li >button{
    width: 93%;
    margin: 0 auto;
    background-color: #fff;
    height: .45rem;
    font-size: .18rem;
    text-align: center;
    border: none;
    border: 1px solid #000;
    margin-top: .2rem;
}
</style>